home *** CD-ROM | disk | FTP | other *** search
/ Champak 62 / Volume 62 - JOGO DISK .iso / Games / penguin_dinner.swf / scripts / __Packages / classes / ui / MapScreen.as < prev    next >
Text File  |  2008-03-17  |  1KB  |  39 lines

  1. class classes.ui.MapScreen extends classes.ui.AbstractWidget
  2. {
  3.    static var BUTTON_CLICKED = "button_clicked";
  4.    function MapScreen()
  5.    {
  6.       super();
  7.       classes.core.SoundManager.getInstance().startMusicTrack("storm_loop");
  8.       this.doLater(this.init);
  9.    }
  10.    function init()
  11.    {
  12.       this.hero.setAnimationState("init_pos_" + classes.core.SOManager.getInstance().__get__currentStage());
  13.       this.animator = new classes.core.Animator([this.hero]);
  14.       this.startLocalLoop(this.update);
  15.       this.next_btn.addEventListener(classes.ui.TextButton.CLICK,this,"onButtonClick");
  16.    }
  17.    function update()
  18.    {
  19.       this.animator.update();
  20.    }
  21.    function onButtonClick(e)
  22.    {
  23.       var _loc0_ = null;
  24.       if((_loc0_ = e.target) === this.next_btn)
  25.       {
  26.          classes.core.WidgetManager.getInstance().lockAllGlobal();
  27.          var _loc2_ = classes.core.SOManager.getInstance().__get__currentStage();
  28.          this.hero.animate(["anim_" + _loc2_,"end_pos_" + _loc2_]);
  29.          this.hero.addEventListener(classes.movieclip.AnimatedClip.COMPLETE_SEQUENCE,classes.core.Application.getInstance(),"gotoGameBoard");
  30.       }
  31.    }
  32.    function dispose()
  33.    {
  34.       this.next_btn.dispose();
  35.       this.animator.dispose();
  36.       super.dispose();
  37.    }
  38. }
  39.